import Main from './Main';
import { ThemeContext } from './context';

class App extends React.Component {
  state = {
    theme: 'orange'
  };

  themeChange(theme) {
    this.setState({
      theme: theme
    });
  }

  render() {
    return (
      //给子组件提供value
      <ThemeContext.Provider value={this.state.theme}>
        <Main themeChange={this.themeChange.bind(this)}></Main>
      </ThemeContext.Provider>
    );
  }
}

export default App;
